﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Reflection;
using System.Text;

namespace DbManager.Query
{
    public class SqlQuery
    {
        static readonly Dictionary<string, object> reservedWords = 
            new Dictionary<string, object>();

        public SqlQuery() { }

        public SqlQuery(List<SqlParameter> parameters)
        {
            if (parameters == null) throw new ArgumentNullException("SqlQueryParameters");
            _parameters.AddRange(parameters);
        }

        static SqlQuery()
        {
            String dir = Directory.GetCurrentDirectory();
            dir = Directory.GetParent(Directory.GetParent((Directory.GetParent(dir).ToString())).ToString()).ToString(); ;
            using (StreamReader reader = new StreamReader(
                dir + "\\ReservedWords.txt"))
            {
                string s;
                while ((s = reader.ReadLine()) != null)
                    reservedWords.Add(s, s);
            }
        }

        readonly List<SqlParameter> _parameters = new List<SqlParameter>();
        public List<SqlParameter> Parameters
        {
            get { return _parameters; }
        }

        private QueryType _queryType = QueryType.Select;
        public QueryType QueryType
        {
            get { return _queryType; }
            set { _queryType = value; }
        }
    }
}
